/**
*  \file canid.h
*
*  \brief CAN Identifier definition
*
*  \author Michael J. Hohmann  michael.hohmann@linde-mh.de
*
*/
#ifndef CANID_H_INCLUDED
#define CANID_H_INCLUDED

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"

/*================================================[ public defines   ]================================================*/

/*================================================[ public datatypes ]================================================*/


/** Identifier external CAN-Bus */
enum canid_ext
{
    canid_ext_module_control            = 0x000,
    canid_ext_sync                      = 0x080,    /**<  Sync Message                                           */

    canid_ext_trac_pdo2                 = 0x081,    /**<                                                        */
    canid_ext_lift_pdo1_2               = 0x182,    /**<                                                         */

    candi_ext_MotorT_PDO2               = 0x28A,    /**<                                                          */

    canid_ext_vc_heartbeat              = 0x701,    /**< Heartbeat Vehicle Controller                            */
    canid_ext_mc_heartbeat              = 0x705,    /**< Heartbeat Motor Controller                              */

    canid_ext_tester_kwp_common_req     = 0x780,    /**<                                                         */
    canid_ext_tester_kwp_vc_req         = 0x781,    /**<                                                         */
    canid_ext_vc_kwp_resp               = 0x791,    /**<                                                         */

    canid_ext_sim_digital_input_0       = 0x7A0,
    canid_ext_sim_digital_input_1       = 0x7A1,
    canid_ext_sim_analog_input_0        = 0x7A4,
    canid_ext_sim_analog_input_1        = 0x7A5,
    canid_ext_sim_analog_input_2        = 0x7A6,
    canid_ext_sim_analog_input_3        = 0x7A7,
    canid_ext_sim_analog_input_4        = 0x7A8,
    canid_ext_sim_analog_input_5        = 0x7A9,

    canid_ext_sim_digital_output_0      = 0x7B0,
    canid_ext_sim_digital_output_1      = 0x7B1,
    canid_ext_sim_pwm_output            = 0x7B2,

    /* linde protocol*/
    Module_Control_Tx                   = 0x000,
    SYNC_Tx                             = 0x080,
    TimeStamp_Rx                        = 0x0FF,
    Motor_Heartbeat_Rx                  = 0x70A,
    MotorL_PDO1_Rx                      = 0x18E,
    MotorL_PDO2_Rx                      = 0x28E,
    MotorL_PDO3_Rx                      = 0x38E,
    MotorT_PDO1_Rx                      = 0x18A,
    MotorT_PDO2_Rx                      = 0x28A,
    MotorT_PDO3_Rx                      = 0x38A,
    DebugV_PDO0_Tx                      = 0x620,
    DebugV_PDO1_Tx                      = 0x621,
    DebugV_PDO2_Tx                      = 0x622,
    DebugV_PDO3_Tx                      = 0x623,
    DebugV_PDO4_Tx                      = 0x624,
    DebugV_PDO0_Rx                      = 0x625,
    V_Lift_PDO1_TX                      = 0x182,
    V_Lift_PDO2_TX                      = 0x282,
    V_PDO3_TX                           = 0x381,
    V_Trac_PDOF_TX                      = 0x81,
    V_Trac_PDO4_TX                      = 0x481,
    V_Trac_PDO1_TX                      = 0x181,
    V_Trac_PDO2_TX                      = 0x281,
    V_Trac_PDO5_TX                      = 0x304,
    V_Trac_Heartbeat                    = 0x701,


    V_INT_TX_PDO1                       = 0x181,
    V_INT_TX_PDO2                       = 0x281,
    V_INT_TX_PDO3                       = 0x381,
    V_INT_TX_PDO4                       = 0x481,


    V_INT_RX_PDO1                       = 0x18A,
    V_INT_RX_PDO2                       = 0x28A,
    V_INT_RX_PDO3                       = 0x38A,
    V_INT_RX_PDO4                       = 0x48A,

    LILOBMS_PDO1_RX                     = 0x18D,
    LILOBMS_PDO2_RX                     = 0x28D,   
    LILOBMS_PDO3_RX                     = 0x38D,
    LILOBMS_PDO4_RX                     = 0x48D, 
    LILOBMS_PDO5_RX                     = 0x301, 
    LILOBMS_PDO6_RX                     = 0x68D, 

    LILOBMS_SDO_RX                      = 0x58D, 
    LILOBMS_SDO_TX                      = 0x60D, 

    LILOBMS_HEARTBEAT                   = 0x70D, 
                                        
    can_id_kwp_rx_common                = 0x780,
    can_id_trac_kwp_rx                  = 0x781,
    can_id_trac_kwp_tx                  = 0x791,


};


/** Identifier of internal CAN-Bus */
enum canid_int
{
    canid_int_module_control                   = 0x000,
    canid_int_sync                             = 0x080, /**<  Sync Message                                           */
                                               
    canid_int_pdo_1                            = 0x100, /**< todo only for test - please remove                      */
    canid_int_pdo_2                            = 0x110  /**< todo only for test - please remove                      */
};

/*================================================[ public variables ]================================================*/

/*================================================[ inline functions ]================================================*/

/*================================================[ public functions ]================================================*/

/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
 *                             Copyright 2018 Linde Material Handling. All rights reserved.                             *
 ***********************************************************************************************************************/
